package com.qidianit.mes.common.exceptions;

import com.qidianit.mes.common.Constant;

/**
 * @company 起点编程
 * @author 戴着假发的程序员
 * @date 2025/7/22 10:48
 * @description 业务异常类，用于封装业务逻辑错误
 */
public class BusinessException extends RuntimeException {
    private final int code;

    public BusinessException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message) {
        this(Constant.ERROR_CODE, message);
    }

    public BusinessException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
    }

    public int getCode() {
        return code;
    }
}